

/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* runningSum(int* nums, int numsSize, int* returnSize)
{

    int* array = malloc(numsSize * sizeof(int));
    if(array==NULL)
    {
        return NULL;
    }
    array[0]=nums[0];
    for(int i=1;i<numsSize;i++)
    {
        array[i]=array[i-1]+nums[i];
    }
    *returnSize=numsSize;
    return array;
}
//